'use strict';
let Response = require('../../../model/Response');
let RestifyProxy = require('../../../util/RestifyProxy');
let CustomPageBean = require('../../../model/CustomPageBean');
let backlogService = require('../../../service/workorder/backlogService');
let logger = require('../../../util/LoggerUtil').logger('backlogController.js');

/**
 * 待办工单——页面
 */
module.exports.backlogPage = function () {
    let response = new Response();
    response.render('back/workorder/backlog/backlog');
    this.resolve(response);
};
/**
 * 待办工单——待签收列表
 */
module.exports.signList  = async function () {
    let req = this.req;
    let params = req.body;
    let response = new Response();
    try {
        let result = await backlogService.signList(this, params);
        let pageBean = new CustomPageBean(result);
        response.send(pageBean);
    } catch (error) {
        logger.error(error);
    }
    this.resolve(response);
};
/**
 * 待办工单——待审核列表
 */
module.exports.disposeList  = async function () {
    let req = this.req;
    let params = req.body;
    let response = new Response();
    try {
        let result = await backlogService.disposeList(this, params);
        let pageBean = new CustomPageBean(result);
        response.send(pageBean);
    } catch (error) {
        logger.error(error);
    }
    this.resolve(response);
};
/**
 * 待办工单——待处理列表
 */
module.exports.auditList = async function () {
    let req = this.req;
    let params = req.body;
    let response = new Response();
    try {
        let result = await backlogService.auditList(this, params);
        let pageBean = new CustomPageBean(result);
        response.send(pageBean);
    } catch (error) {
        logger.error(error);
    }
    this.resolve(response);
};